package com.yuanfengerp.basicInfoManage.warehouseinfo.contorller;

import com.yuanfengerp.basicInfoManage.warehouseinfo.model.Warehouseinfo;
import com.yuanfengerp.basicInfoManage.warehouseinfo.service.impl.WarehouseinfoImpl;
import com.yuanfengerp.publicUtil.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;


@CrossOrigin
@RestController
public class WarehouseCon {
    @Autowired
    WarehouseinfoImpl whsi;

    //查询全部仓库
    @PostMapping("/selectAllWarehouse")
    public Result selectWarehouse(@RequestBody Map<String ,Object> params){
        return whsi.selectWarehouseAll(params);
    }


    //新增仓库信息
    @PostMapping("/addwarehouse")
    public Result addwarehouse(@RequestBody Warehouseinfo warehouseinfo){
        return whsi.addwarehouse(warehouseinfo);
    }

    //修改仓库信息
    @PostMapping("/updatewarehouse")
    public Result updatewarehouse(@RequestBody Warehouseinfo warehouseinfo){
        return whsi.updatewarehouse(warehouseinfo);
    }

    //查询单个仓库全部信息
    @PostMapping("/selectwsinfo")
    public Result selectwsinfo(String id){
        return whsi.selectwsinfo(id);
    }


    //批量删除仓库信息
    @PostMapping("/deletewarehouse")
    public Result deletewarehouse(String[] warehouse_ID){
        return whsi.deletewarehouse(warehouse_ID);
    }




}
